﻿using Microsoft.EntityFrameworkCore;

namespace Entity
{
    public class ApiDbContext : DbContext
    {
        public ApiDbContext(DbContextOptions<ApiDbContext> opts) : base(opts)
        {

        }
        public DbSet<User> User { get; set; }

        public DbSet<BillFare> BillFare { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User>().HasData([
                new User(){
                    AddTime = DateTime.Now,
                    FirstName="zhangsan"
                },
                new User(){
                    AddTime = DateTime.Now,
                    FirstName="zhangsan"
                }
                ]);
        }
    }
}
